﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace LoadTestRamp.Plugin
{
    /// <summary>
    /// Class HostNameValueDescriptorAttribute provides the current hostname as DefaultValue
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event)]
    public class HostnameDefaultValueAttribute : DefaultValueAttribute
    {
        private string hostnameValue = null;

        public HostnameDefaultValueAttribute(string value) : base(value)
        {
            this.hostnameValue = value;
        }

        public override object Value
        {
            get { return System.Environment.GetEnvironmentVariable("COMPUTERNAME"); }
        }
    }
}
